package builder;

/**
 * @Description: null
 * @Project: testDemo
 * @Author: hjibo
 * @CreateDate: 2019/2/22 12:29
 * @ModificationHistory: （who whatTime doWhat）
 */
public class Main {

public static void main(String[] args) {
    // 创建对象
    Condition condition1 = new Condition.Builder()
            .setStr1("aa")
            .setStr2("bb")
            .setStr3("cc")
            .setStr4("dd")
            .setStr5("ee")
            .setStr6("rr")
            .setStr7("tt")
            .setStr8("yy")
            .setStr9("uu")
            .setStr10("ii")
            .build();
    System.out.println("condition1："+condition1.toString());

//    Condition condition2 = condition1;
//    condition2.setStr1("aaaa");
//    System.out.println("condition2："+condition2.toString());
//
//    // 看这里
//    System.out.println("condition1："+condition1.toString());


    try {
        Condition condition2 = (Condition)condition1.clone();
        condition2.setStr1("aaaa");
        condition2.setStr2("bbbb");
        System.out.println("condition2："+condition2.toString());
        System.out.println("condition1："+condition1.toString());
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }

//    Condition condition2 = new Condition.Builder()
//            .setStr1("aaaa")
//            .setStr2("bb")
//            .setStr3("cc")
//            .setStr4("dd")
//            .setStr5("ee")
//            .setStr6("rr")
//            .setStr7("tt")
//            .setStr8("yy")
//            .setStr9("uu")
//            .setStr10("ii")
//            .build();
//    System.out.println("condition2："+condition2.toString());
}
}
